<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/static/common/inner-header.jspf"%>
<title>班级列表</title>
</head>
<body bgcolor="#ADD8E6">
 

   <table border="1" width="100%">
	 <caption><h1><a href="<%=request.getContextPath() %>/yecclass/ClassServlet?command=updateclassback" title="点击新增班级" style="text-decoration:none">班级管理</a></h1></caption>
	
	<thead>
	 <tr align="left" height="50px">
	  <th  colspan="6">
	    <form action="<%=request.getContextPath()%>/yecclass/ClassServlet?command=get" method="post">
	                 名　　称:<input type="text" value="${coursename }" name="coursename"/>　　　
	                 创建时间:<input type="date" value="${createtimeup }" name="createtimeup"/>—<input type="date" value="${createtimedown }" name="createtimedown"/>
	       <input type="submit" value="提交"/>
	    </form>
	  </th>
	 </tr>
	</thead>
	  <tbody>
	   <tr align="center" bgcolor="#CCFFFF" height="30px">
	      <th><b>名　　称</b></th>
	      <th><b>关联课程</b></th>
	      <th><b>创建时间</b></th>
	      <th><b>用户状态</b></th>
	      <th><b>备　　注</b></th>
	      <th><b>操　　作</b></th>
	   </tr>
	  </tbody>
	  
	  <tfoot>${IfError }
	   <c:forEach items="${listUser }" var="position" varStatus="v">
	     <tr>
	      <th>${position.name }</th>
	      <th>${position.course_name }</th>
	      <th><fmt:formatDate value="${position.operateTime }" pattern="yyyy-MM-dd HH:mm:ss"/></th>
	      <th>
	       <c:set var="state" value="${position.state }"></c:set>
	       <c:if test="${state == 1}">已启用</c:if>
	      </th>
	        
	      <th>${position.memo }</th>
	        
	        
	      <th><a href="<%=request.getContextPath() %>/yecclass/ClassServlet?command=updateback&id=${position.id }">修改</a> 
	           |
	        <c:set var="state" value="${position.state }"></c:set>
	         
	        <c:if test="${state == 1}">
	         <a href="javascript:void(0)"  onclick="return openwin(${position.state},${position.id })">  
	                              禁用
	           </a>
	        </c:if>
	        <c:if test="${state == 2}">
	          <a href="<%=request.getContextPath()%>/yecclass/ClassServlet?command=updateState&state=${position.state}&id=${position.id }">  
	                             启用
	          </a>
	        </c:if>
	        
	           |
	       <a href="<%=request.getContextPath() %>/yecclass/ClassServlet?command=classdelete&id=${position.id }" onclick="return confirm('删除不可恢复，请确认？');">删除</a></th>
	    </tr>
	  </c:forEach>
	  </tfoot>
	</table>
<script language="javascript"> 

   function openwin(state,id){

	   var r=confirm("禁止将限制登录，请确认！");
	   if(r ==true){
		   window.location.href="<%=request.getContextPath()%>/yecclass/ClassServlet?command=updateState&state="+state+"&id="+ id; 
	   }else{
		   return;
	   }
	 } 

</script>
</body>
</html>